package net.ozgul.chordmaster;

import java.util.Arrays;
import java.util.Iterator;
import java.util.List;

public enum ScaleType implements Iterable<Interval> {

  MAJOR(Arrays.asList(new Interval[] {Interval.UNISON, Interval.SECOND, 
      Interval.MAJORTHIRD, Interval.PERFECTFOURTH, Interval.PERFECTFIFTH, 
      Interval.MAJORSIXTH, Interval.MAJORSEVENTH, Interval.OCTAVE}), "Major"),

  MINOR(Arrays.asList(new Interval[] {Interval.UNISON, Interval.SECOND, 
		Interval.MINORTHIRD, Interval.PERFECTFOURTH, Interval.PERFECTFIFTH, 
		Interval.MINORSIXTH, Interval.MINORSEVENTH, Interval.OCTAVE}), "Minor"),
  
  HARMNONICMINOR(Arrays.asList(new Interval[] {Interval.UNISON, Interval.SECOND, 
			Interval.MINORTHIRD, Interval.PERFECTFOURTH, Interval.PERFECTFIFTH, 
			Interval.MINORSIXTH, Interval.MAJORSEVENTH, Interval.OCTAVE}), "Harmonic Minor"),

  MELODICMINOR(Arrays.asList(new Interval[] {Interval.UNISON, Interval.SECOND, 
		  Interval.MINORTHIRD, Interval.PERFECTFOURTH, Interval.PERFECTFIFTH, 
		  Interval.MAJORSIXTH, Interval.MAJORSEVENTH, Interval.OCTAVE}), "Harmonic Minor"),
  
  CHROMATICSCALE(Arrays.asList(new Interval[] {Interval.UNISON, Interval.FLATSECOND, Interval.SECOND, 
		  Interval.MINORTHIRD, Interval.MAJORTHIRD, Interval.PERFECTFOURTH, Interval.FLATFIFTH, Interval.PERFECTFIFTH,
		  Interval.AUGMENTEDFIFTH, Interval.MAJORSIXTH, Interval.FLATSEVENTH, Interval.MAJORSEVENTH}), "Chromatic");

  private final List<Interval> intervals;
  private final String[] representations;
  
  private ScaleType(List<Interval> intervals, String... reps) {
    this.intervals = intervals;
    this.representations = reps;
  }

  public Iterator<Interval> iterator() {
    return intervals.iterator();
  }
  
  public String getMainRepresentation() {
	return representations[0]; 
  }  
}
